package email

import (
	"fmt"
	"github.com/jordan-wright/email"
	"net/smtp"
)

func SendMail(subject string, content string, to []string) error {
	newEmail := email.NewEmail()
	newEmail.From = ""
	newEmail.To = to
	newEmail.Subject = subject
	newEmail.Text = []byte(content)
	fmt.Println(newEmail)
	auth := smtp.PlainAuth("", "", "", "smtp.aliyun.com")
	err := newEmail.Send("", auth)
	fmt.Println(err)
	return err
}
